package cc.shacocloud.luanniao.core.model.dto.input

import cc.shacocloud.luanniao.core.utils.Json
import org.junit.jupiter.api.Assertions.assertEquals
import org.junit.jupiter.api.Test

/**
 *
 * @author 思追(shaco)
 */
class KnowledgeBaseListInputTest {

    @Test
    fun deserializationTest() {

        val content = """
            {
              "current": 1,
              "size": 10,
              "tagIds": [
                155,
                12
              ],
              "parentId": -9
            }
        """.trimIndent()

        val input = Json.mapper.readValue(content, KnowledgeBaseListInput::class.java)

        println(input)

        assertEquals(input.current, 1)
        assertEquals(input.size, 10)
        assertEquals(input.tagIds[0], 155)
        assertEquals(input.tagIds[1], 12)
        assertEquals(input.parentId, -9)
    }

}